package order

type tOrderItemEntity struct {
	ItemID    int64
	OrderID   int64
	SkuID     int64
	Qty       int
	Price     float64
	Timestamp int64
}

func (me *tOrderItemEntity) Clone() *tOrderItemEntity {
	return &tOrderItemEntity{
		me.ItemID, me.OrderID, me.SkuID, me.Qty, me.Price, me.Timestamp,
	}
}

func (me *tOrderItemEntity) ToOrderItemData() *OrderItemDTO {
	return &OrderItemDTO{
		me.ItemID, me.SkuID, me.Qty, me.Price, me.Timestamp,
	}
}

func (me *tOrderItemEntity) Read(it *OrderItemDTO) {
	me.ItemID = it.ItemID
	me.SkuID = it.SkuID
	me.Qty = it.Qty
	me.Price = it.Price
	me.Timestamp = it.Timestamp
}
